package com.sky.service.common;

import com.sky.dto.DishDTO;
import com.sky.pojo.Dish;
import com.sky.result.PageResult;
import com.sky.result.Result;
import com.sky.vo.DishVO;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface DishService {
    @Transactional
    Result<String> save(DishDTO dishDTO);

    @Transactional
    Result<String> update(DishDTO dishDTO);

    Result<PageResult> page(Integer categoryId, Integer page, Integer pageSize, String name, Integer status);

    Result<String> deleteByIds(Long[] ids);

    List<Dish> list(Integer categoryId);

    Result<DishVO> getById(Long id);

    Result<String> startOrStop(Integer status, Long id);

    /**
     * 条件查询菜品和口味
     * @param dish
     * @return
     */
    List<DishVO> listWithFlavor(Dish dish);
}
